package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;

public class CollectionDemo2 {
    public static void main(String[] args) {
        //Collection a = new ArrayList();
        Collection a = new HashSet();
        a.add(new Point(1,2));
        a.add(new Point(3,4));
        a.add(new Point(5,6));
        a.add(new Point(7,8));
        a.add(new Point(9,10));
        boolean b = a.add(new Point(1,2));
        System.out.println(b);
        System.out.println(a);

        Point p = new Point(1,2);
        boolean c = a.contains(p);
        System.out.println(c);

        a.remove(p);
        System.out.println(a);

    }
}
